package com.skytech.tax.customsdatawarehouse.singlewindow.processtrade.manual.domain.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author Lianhong
 * @since 2021/11/11
 */
public class ManualInvt {

    private String seqNo;
    private String invt;

    private String socialCreditCode;
    private String invtDclTime;
    private String inputTime;
    private String impexpMarkcd;
    private String storageTime;

    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public String getInvt() {
        return invt;
    }

    public void setInvt(String invt) {
        this.invt = invt;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public String getInvtDclTime() {
        return invtDclTime;
    }

    public void setInvtDclTime(String invtDclTime) {
        this.invtDclTime = invtDclTime;
    }

    public String getInputTime() {
        return inputTime;
    }

    public void setInputTime(String inputTime) {
        this.inputTime = inputTime;
    }

    public String getImpexpMarkcd() {
        return impexpMarkcd;
    }

    public void setImpexpMarkcd(String impexpMarkcd) {
        this.impexpMarkcd = impexpMarkcd;
    }

    public String getStorageTime() {
        return storageTime;
    }

    public void setStorageTime(String storageTime) {
        this.storageTime = storageTime;
    }

    public ManualInvtSimple buildManualInvtSimple() {
        ManualInvtSimple simple = new ManualInvtSimple();
        simple.setSeqNo(seqNo);
        return simple;
    }

    public void addFields() {
        JSONObject invt = JSON.parseObject(this.invt);
        JSONObject invtHeadType = invt.getJSONObject("invtHeadType");
        this.invtDclTime = invtHeadType.getString("invtDclTime");
        this.inputTime = invtHeadType.getString("inputTime");
        this.impexpMarkcd = invtHeadType.getString("impexpMarkcd");
    }
}
